// 信息录入接口
import request from '/@/utils/request';
const headers = {
	onlyData: true,
};

//信息录入列表
export const sensitiveApplicationPageApi = (params: any) => {
	if(params.timeArr){
        params['developBeginDate'] = params.timeArr[0]
        params['developEndDate'] = params.timeArr[1]
    }
    delete params.timeArr
	return request({
		url: `/manage/sensitiveApplication/page`,
		method: 'get',
		headers,
		params,
	});
};
//信息录入删除
export const sensitiveApplicationDelApi = (data: any) => {
	return request({
		url: `/manage/sensitiveApplication/delete/${data.sensitiveId}`,
		method: 'DELETE',
		headers,
	
	});
};


//信息录入新增/编辑
export const sensitiveApplicationAddApi = (data: any) => {
	if(data.sensitiveId){
    	return request({
			url: `/manage/sensitiveApplication/edit`,
			method: 'put',
			headers: {
				onlyData: true,
				showSuccessMessage: true,
			},
			data,
		});
    }else{
		return request({
			url: `/manage/sensitiveApplication/saveSensitive`,
			method: 'post',
			data,
			headers: {
				onlyData: true,
				showSuccessMessage: true,
			},
		
		});
	}

};
//信息录入详情
export const sensitiveApplicationDetailApi = (params: any) => {
	return request({
		url: `/manage/sensitiveApplication/sensitiveDetail/${params.sensitiveId}`,
		method: 'get',
		headers
	});
};
//责任部门
// export const sensitiveAppTreeAndSelfApi = (params: any) => {
// 	return request({
// 		url: `/admin/dept/treeAndSelf`,
// 		method: 'get',
// 		headers,
// 		params,
// 	});
// };
export const sensitiveAppTreeAndSelfApi = () => {
	return request({
		url: `/admin/dept/tree`,
		method: 'get',
		headers,
		
	});
};

